<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        /* 
            数组的增删改查
         */

         var fruits = ['Apple','Banana'];
         console.log(fruits)

         var fruits2 = fruits.push('abc')//push返回数组长度
         console.log(fruits)
         console.log(fruits2)

            const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato'];

            // console.log(plants.pop());+
            // Expected output: "tomato"

            // console.log(plants);
            // Expected output: Array ["broccoli", "cauliflower", "cabbage", "kale"]

            // plants.pop(0);

            // console.log(plants);
            // Expected output: Array ["broccoli", "cauliflower", "cabbage"]

            var plants2 = plants.unshift('11')
            console.log(plants)//(6) ['11', 'broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato']
    </script>
</head>
<body>
    
</body>
</html>